<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>SecRole管理</title>
    <th:block th:include="import :: links"></th:block>
    <th:block th:include="import :: linksTable"></th:block>
    <link th:href="@{/plugins/zTree_v3/css/zTreeStyle/zTreeStyle.css}" rel="stylesheet"/>
    <meta name="_csrf" th:content="${_csrf.token}"/>
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>
</head>
<body>
<div id="main">
    <div id="toolbar">
        <a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="fa fa-plus"></i> 新增</a>
        <a class="waves-effect waves-button" href="javascript:;" onclick="updateAction()"><i class="fa fa-edit"></i> 编辑</a>
        <a class="waves-effect waves-button" href="javascript:;" onclick="deleteAction()"><i class="fa fa-close"></i> 删除</a>
        <a class="waves-effect waves-button" href="javascript:;" onclick="grantAction()"><i class="fa fa-shield"></i> 授权</a>
        <a class="waves-effect waves-button" href="javascript:;" onclick="initRoleAction()"><i class="fa fa-shield"></i> 重载</a>
        <a class="waves-effect waves-button" href="javascript:;" onclick="roleUserAction()"><i class="fa fa-eye"></i> 查看用户</a>
    </div>
    <table id="table"></table>
</div>
<!-- editDialog-->
<div class="modal fade" id="grantRoleModal" tabindex="-1" aria-labelledby="dictLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="grantdictLabel">角色授权</h4>
            </div>
            <div class="modal-body" style="height: 300px;overflow-y:auto;">
                <input type="hidden" id="needRid" value="-1"/>
                <ul id="authTree" class="ztree" style="width: 100%;height: 100%;"></ul>
            </div>
            <div class="modal-footer">
                <a class="waves-effect waves-button" href="javascript:;" data-dismiss="modal"><i class="fa fa-close"></i> 关闭</a>
                <a class="waves-effect waves-button" href="javascript:;" onclick="grant()"><i class="fa fa-shield"></i> 授权</a>
            </div>
        </div>
    </div>
</div>

<!-- editDialog-->
<div class="modal fade" id="userOfRoleModal" tabindex="-1" aria-labelledby="dictLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">角色用户</h4>
            </div>
            <div class="modal-body" style="height: 300px;overflow-y:auto;">
                <table id="userTable"></table>
            </div>
            <div class="modal-footer">
                <a class="waves-effect waves-button" href="javascript:;" data-dismiss="modal"><i class="fa fa-close"></i> 关闭</a>
            </div>
        </div>
    </div>
</div>
<th:block th:include="import :: impJS"></th:block>
<th:block th:include="import :: impJSTable"></th:block>
<script type="text/javascript" th:src="@{/plugins/zTree_v3/js/jquery.ztree.all.min.js}"></script>
<script type="text/javascript" th:src="@{/js/sec/role/index.js}"></script>
</body>
</html>